from django.db import models


class Covid(models.Model):
    area = models.CharField(max_length=100 ,    blank=True , null=True)
    country = models.CharField(max_length=200 ,    blank=True , null=True)
    confirmedCases = models.IntegerField(max_length=500 , blank=True , null=True)
    fatalities = models.IntegerField(max_length=500 , blank=True , null=True)
    date = models.DateField()

    class Meta:
        db_table = 'covids'
        app_label = "predict"

    def obj_to_dict(self):
        return {
            'area':self.area,
            'country':self.country,
            'confirmedCases':self.confirmedCases,
            'fatalities':self.fatalities,
            'date':self.date,

        }


class forcast_lightgbm(models.Model):
    area = models.CharField(max_length=100, blank=True, null=True)
    country = models.CharField(max_length=200, blank=True, null=True)
    date = models.DateField()

    predConfirmedCases = models.FloatField(max_length=500 , blank=True , null=True)
    predFatalities = models.FloatField(max_length=500 , blank=True , null=True)

    class Meta:
        app_label = "predict"
        db_table = 'yuce_forcast_lightgbm'


class forcast_xgboost(models.Model):
    area = models.CharField(max_length=100, blank=True, null=True)
    country = models.CharField(max_length=200, blank=True, null=True)
    date = models.DateField()

    predConfirmedCases = models.FloatField(max_length=500 , blank=True , null=True)
    predFatalities = models.FloatField(max_length=500 , blank=True , null=True)

    class Meta:
        app_label = "predict"
        db_table = 'yuce_forcast_xgboost'


class forcast_rf(models.Model):
    area = models.CharField(max_length=100, blank=True, null=True)
    country = models.CharField(max_length=200, blank=True, null=True)
    date = models.DateField()

    predConfirmedCases = models.FloatField(max_length=500 , blank=True , null=True)
    predFatalities = models.FloatField(max_length=500 , blank=True , null=True)

    class Meta:
        app_label = "predict"
        db_table = 'yuce_forcast_rf'


class forcast_rnn(models.Model):
    area = models.CharField(max_length=100, blank=True, null=True)
    country = models.CharField(max_length=200, blank=True, null=True)
    date = models.DateField()

    class Meta:
        app_label = "predict"
    predConfirmedCases = models.FloatField(max_length=500 , blank=True , null=True)
    predFatalities = models.FloatField(max_length=500 , blank=True , null=True)

    class Meta:
        app_label = "predict"
        db_table = 'yuce_forcast_rnn'


class forcast_pr(models.Model):
    area = models.CharField(max_length=100, blank=True, null=True)
    country = models.CharField(max_length=200, blank=True, null=True)
    date = models.DateField()

    predConfirmedCases = models.FloatField(max_length=500 , blank=True , null=True)
    predFatalities = models.FloatField(max_length=500 , blank=True , null=True)

    class Meta:
        app_label = "predict"
        db_table = 'yuce_forcast_pr'
